Crate axum_auth

source ·
Expand description

High-level http auth extractors for axum

🚨 This crate provides an alternative to TypedHeader<Authorization<..>> which you should probably use instead. Take a look at the fantastic axum-login crate if your looking for more robust session management. I will continue to maintain this crate.

Usage

Take a look at the following structures:

If you need to implement custom errors (i.e., status codes and messages), use these:

That’s all there is to it! Check out the repository for contributing or some more documentation.

Structs

  • Basic authentication extractor, containing an identifier as well as an optional password
  • Bearer token extractor which contains the innards of a bearer header as a string

Traits

  • Custom extractor trait for basic auth allowing you to implement custom responses
  • Custom extractor trait for bearer allowing you to implement custom responses

Type Aliases